<!DOCTYPE html>
<html lang="zh-Hans-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    body {
      background-color: #f1f2f3;
    }

    header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      background-color: #ffffff;
    }

    .nav {
      display: flex;
      list-style: none;
    }

    .nav>li {
      font-size: 14px;
      min-width: 60px;
      height: 50px;
      line-height: 50px;
      text-align: center;
      cursor: pointer;
      position: relative;
    }

    .subnav {
      position: absolute;
      list-style: none;
      background-color: #fff;
      white-space: nowrap;
      overflow: hidden;
      transition: all cubic-bezier(0.22, 0.58, 0.12, 0.98) 0.4s;
    }
  </style>
</head>

<body>
  <header>
    <nav>
      <ul class="nav">
        <li>
          <span>网游</span>
          <ul class="subnav">
            <li>
              <span>英雄联盟</span>
            </li>
            <li>
              <span>穿越火线</span>
            </li>
            <li>
              <span>CS:GO</span>
            </li>
            <li>
              <span>APEX英雄</span>
            </li>
            <li>
              <span>DOTA2</span>
            </li>
          </ul>
        </li>
        <li>
          <span>手游</span>
          <ul class="subnav">
            <li>
              <span>
                王者荣耀
              </span>
            </li>
            <li>
              <span>
                和平精英
              </span>
            </li>
            <li>
              <span>
                LOL手游
              </span>
            </li>
            <li>
              <span>
                原神
              </span>
            </li>
            <li>
              <span>第五人格</span>
            </li>
          </ul>
        </li>
        <li>
          <span>单机游戏</span>
        </li>
        <li>
          <span>娱乐</span>
        </li>
        <li>
          <span>电台</span>
        </li>
        <li>
          <span>虚拟主播</span>
        </li>
        <li>
          <span>生活</span>
        </li>
        <li>
          <span>学习</span>
        </li>
        <li>
          <span>赛事</span>
        </li>
      </ul>
    </nav>
  </header>
  <script>
    const arr = document.querySelectorAll(".nav>li")
    console.log(arr);
    arr.forEach(nav => {
      nav.addEventListener("mouseenter", (e) => {
      })
    })

  </script>
</body>

</html>